include ../Makefile.am

SOURCES = 	boot/boot.o \
		\
		fs/vfs.o fs/vfscall.o fs/devfs/devfs.o fs/inode.o \
		\
		net/net.o \
		\
		system/kernel.o system/mod.o io.o system/syscall.o system/syscall_handler.o system/term.o \
		system/device.o system/debug.o system/installer.o \
		\
		\
		\
		driver/video.o driver/cpu.o driver/timer.o \
		\
		driver/fs/ramfs/ramfs.o driver/fs/ext2/ext2.o \
		\
		driver/hi/keyboard/keyboard.o driver/rtc.o driver/hi/mouse/mouse.o \
		\
		driver/storage/ata_pio/ata_pio.o driver/storage/floppy/floppy.o	\
		\
		driver/network/rtl8139/rtl8139.o driver/network/ne2000/ne2000.o driver/network/serial/serial.o\
		\
		driver/system/null/null.o driver/system/random/random.o \
		\
		driver/graphics/vesa/vesa.o \
		\
		\
		\
		mmu/mmu.o mmu/physical.o mmu/paging.o mmu/kheap.o \
		\
		klibc/stdio.o klibc/math.o klibc/string.o klibc/malloc.o klibc/typeconv.o klibc/time.o \
		\
		shell/shell.o shell/var.o shell/cmd.o \
		\
		interrupt/gdt.o  interrupt/idt.o interrupt/isr.o interrupt/irq.o \
		interrupt/gdt_flush.o interrupt/idt_load.o interrupt/isr_stub.o interrupt/irq_stub.o \
		\
		task/tss.o task/task.o

CFLAGS =  -fno-stack-protector -nostdlib -nostdinc -fno-builtin  -I"."  
CXXFLAGS = -fomit-frame-pointer -O -Wall  -nostdlib   -nostdinc -fno-builtin -fno-exceptions -fno-rtti -I"." 
#-fno-stack-protector
LDFLAGS=-Tlink.ld
ASFLAGS=-felf

.c.o:
	$(CC) -c $(CFLAGS) -o "$@" "$<"
	
all: $(SOURCES) link

clean:
	-rm $(SOURCES) kernel

link:
	ld -T link.ld -o kernel $(SOURCES)

.s.o:
	nasm -felf $<

